#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

def printCoords(event):
    print event.x, event.y

bt1 = Button(root, text='leftmost button')
bt1.bind('<ButtonRelease-1>', printCoords)

bt2 = Button(root, text='middle button')
bt2.bind('<ButtonRelease-2>', printCoords)

bt3 = Button(root, text='rightmost button')
bt3.bind('<ButtonRelease-3>', printCoords)

bt1.grid()
bt2.grid()
bt3.grid()

root.mainloop()
